import { useContext } from 'react';
import { ThemeContext } from '@/contexts/themeContext';

// 使用ThemeContext的自定义hook
export function useTheme() {
  const context = useContext(ThemeContext);
  if (!context) {
    throw new Error('useTheme must be used within a ThemeProvider');
  }
  return context;
}